home *** CD-ROM | disk | FTP | other *** search
/ Aminet 48 / Aminet 48 (2002)(GTI - Schatztruhe)[!][Apr 2002].iso / Aminet / text / edit / vim60rt.lha / Vim / vim60 / doc / vi_diff.txt < prev    next >
Encoding:
Text File  |  2001-09-26  |  35.0 KB  |  868 lines

  1. *vi_diff.txt*   For Vim version 6.0.  Last change: 2001 Sep 03
  2.  
  3.  
  4.           VIM REFERENCE MANUAL    by Bram Moolenaar
  5.  
  6.  
  7. Differences between Vim and Vi                *vi-differences*
  8.  
  9. Throughout the help files differences between Vim and Vi/Ex are given in
  10. curly braces, like "{not in Vi}".  This file only lists what has not been
  11. mentioned in other files and gives an overview.
  12.  
  13. Vim is mostly POSIX 1003.2-1 compliant.  The only command known to be missing
  14. is ":open".  There are probably a lot of small differences (either because Vim
  15. is missing something or because Posix is beside the mark).
  16.  
  17. 1. Missing commands            |missing-commands|
  18. 2. Missing options            |missing-options|
  19. 3. Limits                |limits|
  20. 4. The most interesting additions    |vim-additions|
  21. 5. Other vim features            |other-features|
  22. 6. Command-line arguments        |cmdline-arguments|
  23.  
  24. ==============================================================================
  25. 1. Missing commands                    *missing-commands*
  26.  
  27. This command is in Vi, but not in Vim:
  28.  
  29. :o[pen]            {Vi: start editing in open mode} *:o* *:op* *:open*
  30.  
  31. ==============================================================================
  32. 2. Missing options                    *missing-options*
  33.  
  34. These options are in the Unix Vi, but not in Vim.  If you try to set one of
  35. them you won't get an error message, but the value is not used and cannot be
  36. printed.
  37.  
  38. autoprint (ap)        boolean    (default on)        *'autoprint'* *'ap'*
  39. beautify (bf)        boolean    (default off)        *'beautify'* *'bf'*
  40. flash (fl)        boolean    (default ??)        *'flash'* *'fl'*
  41. graphic (gr)        boolean    (default off)        *'graphic'* *'gr'*
  42. hardtabs (ht)        number    (default 8)        *'hardtabs'* *'ht'*
  43.     number of spaces that a <Tab> moves on the display
  44. mesg            boolean    (default on)        *'mesg'*
  45. novice            boolean    (default ??)        *'novice'*
  46. open            boolean    (default on)        *'open'*
  47. optimize (op)        boolean    (default off)        *'optimize'* *'op'*
  48. prompt            boolean    (default on)        *'prompt'*
  49. redraw            boolean    (default off)        *'redraw'*
  50. slowopen (slow)        boolean    (default off)        *'slowopen'* *'slow'*
  51. sourceany        boolean    (default off)        *'sourceany'*
  52. window (wi)        number    (default 23)        *'window'* *'wi'*
  53. w300            number    (default 23)        *'w300'*
  54. w1200            number    (default 23)        *'w1200'*
  55. w9600            number    (default 23)        *'w9600'*
  56.  
  57. ==============================================================================
  58. 3. Limits                        *limits*
  59.  
  60. Vim has only a few limits for the files that can be edited {Vi: can not handle
  61. <Nul> characters and characters above 128, has limited line length, many other
  62. limits}.
  63.                             *E340*
  64. Maximum line length       On machines with 16-bit ints (Amiga and MS-DOS real
  65.                mode): 32767, otherwise 2147483647 characters.
  66.                Longer lines are split.
  67. Maximum number of lines       2147483647 lines.
  68. Maximum file size       2147483647 bytes (2 Gbyte) when a long integer is
  69.                32 bits.  Much more for 64 bit longs.  Also limited
  70.                by available disk space for the |swap-file|.
  71.                             *E75*
  72. Length of a file path       Unix and Win32: 1024 characters, otherwise 256
  73.                characters (or as much as the system supports).
  74. Length of an expanded string option
  75.                Unix and Win32: 1024 characters, otherwise 256
  76.                characters
  77. Maximum display width       Unix and Win32: 1024 characters, otherwise 255
  78.                characters
  79. Maximum lhs of a mapping   50 characters.
  80. Number of highligthing different types: 223
  81.  
  82. Information for undo and text in registers is kept in memory, thus when making
  83. (big) changes the amount of (virtual) memory available limits the number of
  84. undo levels and the text that can be kept in registers.  Other things are also
  85. kept in memory:  Command-line history, error messages for Quickfix mode, etc.
  86.  
  87. Memory usage limits
  88. -------------------
  89.  
  90. The option 'maxmem' ('mm') is used to set the maximum memory used for one
  91. buffer (in kilobytes).  'maxmemtot' is used to set the maximum memory used for
  92. all buffers (in kilobytes).  The defaults depend on the system used.  For the
  93. Amiga and MS-DOS, 'maxmemtot' is set depending on the amount of memory
  94. available.  If you don't like Vim to swap to a file, set 'maxmem' and
  95. 'maxmemtot' to a very large value.  The swap file will then only be used for
  96. recovery.  If you don't want a swap file at all, set 'updatecount' to 0, or
  97. use the "-n" argument when starting Vim.  Note that the 'maxmem' option is
  98. only used when a buffer is created.  Changing this option does not affect
  99. buffers that have already been loaded.  Thus you can set it to different
  100. values for different files.  'maxmemtot' works always.
  101.  
  102. ==============================================================================
  103. 4. The most interesting additions            *vim-additions*
  104.  
  105. Vi compatibility.                    |'compatible'|
  106.     Although Vim is 99% Vi compatible, some things in Vi can be
  107.     considered to be a bug, or at least need improvement.  But still, Vim
  108.     starts in a mode which behaves like the "real" Vi as much as possible.
  109.     To make Vim behave a little bit better, try resetting the 'compatible'
  110.     option:
  111.         :set nocompatible
  112.     Or start Vim with the "-N" argument:
  113.         vim -N
  114.     This is done automatically if you have a .vimrc file.  See |startup|.
  115.     The 'cpoptions' option can be used to set Vi compatibility on/off for
  116.     a number of specific items.            |'cpoptions'|
  117.  
  118. Support for different systems.
  119.     Vim can be used on:
  120.     - All Unix systems (it works on all systems it was tested on, although
  121.       the GUI and Perl interface may not work everywhere).
  122.     - Amiga (500, 1000, 1200, 2000, 3000, 4000, ...).
  123.     - MS-DOS in real-mode (no additional drivers required).
  124.     - In protected mode on Windows 3.1 and MS-DOS (DPMI driver required).
  125.     - Windows 95 and Windows NT, with support for long file names.
  126.     - OS/2 (needs emx.dll)
  127.     - Atari MiNT
  128.     - VMS
  129.     - BeOS
  130.     - Macintosh
  131.     - Risc OS
  132.     - IBM OS/390
  133.  
  134. Multi level undo.                    |undo|
  135.     'u' goes backward in time, 'ctrl-R' goes forward again.  Set option
  136.     'undolevels' to the number of changes to be remembered (default 1000).
  137.     Set 'undolevels' to 0 for a vi-compatible one level undo. Set it to
  138.     -1 for no undo at all.
  139.  
  140.     When all changes in a buffer have been undone, the buffer is not
  141.     considered changed anymore.  You can exit it with :q, without <!>.
  142.  
  143. Graphical User Interface (GUI)                |gui|
  144.     Included support for GUI: menu's, mouse, scrollbars, etc.  You can
  145.     define your own menus.  Better support for CTRL/SHIFT/ALT keys in
  146.     combination with special keys and mouse.  Currently for X11 (with
  147.     Motif and Athena interfaces), Win32 (Windows 95 and Windows NT), BeOS,
  148.     Amiga and Macintosh.
  149.  
  150. Multiple windows and buffers.                |windows.txt|
  151.     Vim can split the screen into several windows, each editing a
  152.     different buffer or the same buffer at a different location.  Buffers
  153.     can still be loaded (and changed) but not displayed in a window.  This
  154.     is called a hidden buffer.  Many commands and options have been added
  155.     for this facility.
  156.  
  157. Syntax highlighting.                    |:syntax|
  158.     Vim can highlight keywords, patterns and other things.  This is
  159.     defined by a number of ":syntax" commands, and can be made to
  160.     highlight most languages and file types.  A number of files are
  161.     included for highlighting the most common languages, like C, C++,
  162.     Java, Pascal, Makefiles, shell scripts, etc.  The colors used for
  163.     highlighting can be defined for ordinary terminals, color terminals
  164.     and the GUI with the ":highlight" command.
  165.  
  166. Folding                            |folding|
  167.     A range of lines can be shown as one "folded" line.  This allows
  168.     overviewing a file and moving blocks of text around quickly.
  169.     Folds can be created manually, from the syntax of the file, by indent,
  170.     etc.
  171.  
  172. Plugins                            |add-plugin|
  173.     The functionality can be extended by dropping a plugin file in the
  174.     right directory.  That's an easy way to start using Vim scripts
  175.     written by others.  Plugins can be for all kind of files, or
  176.     specifically for a filetype.
  177.  
  178. Repeat a series of commands.                |q|
  179.     'q'{c} starts recording typed characters into named register {c}
  180.     (append to the register if register name is uppercase).  A subsequent
  181.     'q' stops recording.  The register can then be executed with the
  182.     '@'{c} command.  This is very useful to repeat a complex action.
  183.  
  184. Flexible insert mode.                    |ins-special-special|
  185.     The arrow keys can be used in insert mode to move around in the file.
  186.     This breaks the insert in two parts as far as undo and redo is
  187.     concerned.
  188.  
  189.     CTRL-O can be used to execute a single command-mode command.  This is
  190.     almost the same as hitting <Esc>, typing the command and hitting 'a'.
  191.  
  192. Visual mode.                        |Visual-mode|
  193.     Visual can be used to first highlight a piece of text and then give a
  194.     command to do something with it.  This is an (easy to use) alternative
  195.     to first giving the operator and then moving to the end of the text
  196.     to be operated upon.  'v' and 'V' are used to start Visual mode.  'v'
  197.     works on characters and 'V' on lines.  Move the cursor to extend the
  198.     Visual part.  It is shown highlighted on the screen.  By typing 'o'
  199.     the other end of the Visual text can be moved.  The Visual text can
  200.     be affected by an operator:
  201.         d    delete
  202.         c    change
  203.         y    yank
  204.         > or <    insert or delete indent
  205.         !    filter through external program
  206.         =    filter through indent
  207.         :    start ":" command for the Visual lines.
  208.         gq    format text to 'textwidth' columns
  209.         J    join lines
  210.         ~    swap case
  211.         u    make lowercase
  212.         U    make uppercase
  213.  
  214. Block operators.                    |visual-block|
  215.     With Visual a rectangular block of text can be selected.  Start Visual
  216.     with CTRL-V.  The block can be deleted ('d'), yanked ('y') or its case
  217.     can be changed ('~', 'u' and 'U').  A deleted or yanked block can be
  218.     put into the text with the 'p' and 'P' commands.
  219.  
  220. Online help system.                    |:help|
  221.     Help is displayed in a window.  The usual commands can be used to
  222.     move around, search for a string, etc.  Tags can be used to jump
  223.     around in the help files, just like hypertext links.  The ":help"
  224.     command takes an argument to quickly jump to the info on a subject.
  225.     <F1> is the quick access to the help system.  The name of the help
  226.     index file can be set with the 'helpfile' option.
  227.  
  228. Command-line editing and history.            |cmdline-editing|
  229.     You can insert or delete at any place in the command-line using the
  230.     cursor keys.  The right/left cursor keys can be used to move
  231.     forward/backward one character.  The shifted right/left cursor keys
  232.     can be used to move forward/backward one word.  CTRL-B/CTRL-E can be
  233.     used to go to the begin/end of the command-line.
  234.  
  235.                             |cmdline-history|
  236.     The command-lines are remembered.  The up/down cursor keys can be used
  237.     to recall previous command-lines.  The 'history' option can be set to
  238.     the number of lines that will be remembered.  There is a separate
  239.     history for commands and for search patterns.
  240.  
  241. Command-line completion.                |cmdline-completion|
  242.     While entering a command-line (on the bottom line of the screen)
  243.     <Tab> can be typed to complete
  244.        what        example        ~
  245.     - command    :e<Tab>
  246.     - tag        :ta scr<Tab>
  247.     - option    :set sc<Tab>
  248.     - option value  :set hf=<Tab>
  249.     - file name    :e ve<Tab>
  250.     - etc.
  251.  
  252.     If there are multiple matches, CTRL-N (next) and CTRL-P (previous)
  253.     will walk through the matches.  <Tab> works like CTRL-N, but wraps
  254.     around to the first match.
  255.  
  256.     The 'wildchar' option can be set to the character for command-line
  257.     completion, <Tab> is the default.  CTRL-D can be typed after an
  258.     (incomplete) wildcard; all matches will be listed.  CTRL-A will insert
  259.     all matches.  CTRL-L will insert the longest common part of the
  260.     matches.
  261.  
  262. Insert-mode completion                    |ins-completion|
  263.     In insert mode the CTRL-N and CTRL-P keys can be used to complete a
  264.     word that has previously been used.    |i_CTRL-N|
  265.     With CTRL-X another mode is entered, through which completion can be
  266.     done for:
  267.     |i_CTRL-X_CTRL-F|    file names
  268.     |i_CTRL-X_CTRL-K|    words from a dictionary
  269.     |i_CTRL-X_CTRL-I|    words from included files
  270.     |i_CTRL-X_CTRL-L|    whole lines
  271.     |i_CTRL-X_CTRL-]|    words from the tags file
  272.     |i_CTRL-X_CTRL-D|    definitions or macros
  273.  
  274. Long line support                    |'wrap'| |'linebreak'|
  275.     If the 'wrap' option is off, long lines will not wrap and only part
  276.     of them will be shown.  When the cursor is moved to a part that is not
  277.     shown, the screen will scroll horizontally.  The minimum number of
  278.     columns to scroll can be set with the 'sidescroll' option.  The "zh"
  279.     and "zl" commands can be used to scroll sideways.
  280.     Alternatively, long lines are broken in between words when the
  281.     'linebreak' option is set.  This allows editing a single-line
  282.     paragraph conveniently (e.g. when the text is later read into a DTP
  283.     program).  Move the cursor up/down with the "gk" and "gj" commands.
  284.  
  285. Text formatting.                    |formatting|
  286.     The 'textwidth' option can be used to automatically limit the line
  287.     length.  This supplements the 'wrapmargin' option of Vi, which was not
  288.     very useful.  The "gq" operator can be used to format a piece of text
  289.     (for example, "gqap" formats the current paragraph).  Commands for
  290.     text alignment: ":center", ":left" and ":right".
  291.  
  292. Extended search patterns                |pattern|
  293.     There are many extra items to match various text items.  Examples:
  294.     A "\n" can be used in a search pattern to match a line break.
  295.     "x\{2,4}" matches "x" 2 to 4 times.
  296.     "\s" matches a white space character.
  297.  
  298. Edit-compile-edit speedup.                |quickfix|
  299.     The ":make" command can be used to run the compilation and jump to
  300.     the first error.  Alternatively Vim can be started with the "-q"
  301.     option from the compiler.  A file with compiler error messages is
  302.     interpreted.  Vim starts editing at the first error.
  303.  
  304.     Each line in the error file is scanned for the name of a file, line
  305.     number and error message.  The 'errorformat' option can be set to a
  306.     list of scanf-like strings to handle output from many compilers.
  307.  
  308.     The ":cn" command can be used to jump to the next error.
  309.     ":cl" lists all the error messages.  Other commands are available
  310.     (almost the same as with Manx's Z editor on the Amiga).
  311.     The 'makeef' option has the name of the file with error messages.
  312.     The 'makeprg' option contains the name of the program to be executed
  313.     with the ":make" command.
  314.     The 'shellpipe' option contains the string to be used to put the
  315.     output of the compiler into the errorfile.
  316.  
  317. Improved indenting for C programs            |'cindent'|
  318.     When the 'cindent' option is on the indent of each line is
  319.     automatically adjusted.  C syntax is mostly recognized.  The indent
  320.     for various styles can be set with 'cinoptions'.  The keys to trigger
  321.     indenting can be set with 'cinkeys'.
  322.  
  323.     Comments can be automatically formatted.  The 'comments' option can be
  324.     set to the characters that start and end a comment.  This works best
  325.     for C code, but also works for e-mail (">" at start of the line) and
  326.     other types of text.  The "=" operator can be used to re-indent
  327.     lines.
  328.  
  329. Searching for words in include files            |include-search|
  330.     The "[i" command can be used to search for a match of the word under
  331.     the cursor in the current and included files.  The 'include' option
  332.     can be set the a pattern that describes a command to include a file
  333.     (the default is for C programs).
  334.     The "[I" command lists all matches, the "[ CTRL-I" command jumps to
  335.     a match.
  336.     The "[d", "[D" and "[ CTRL-D" commands do the same, but only for
  337.     lines where the pattern given with the 'define' option matches.
  338.  
  339. Automatic commands                    |autocommand|
  340.     Commands can be automatically executed when reading a file, writing a
  341.     file, jumping to another buffer, etc., depending on the file name.
  342.     This is useful to set options and mappings for C programs,
  343.     documentation, plain text, e-mail, etc.  This also makes it possible
  344.     to edit compressed files.
  345.  
  346. Scripts and Expressions                    |expression|
  347.     Commands have been added to form up a simple but powerful script
  348.     language.
  349.     |:if|        Conditional execution, which can be used for example
  350.             to set options depending on the value of $TERM.
  351.     |:while|    Repeat a number of commands.
  352.     |:echo|        Print the result of an expression.
  353.     |:let|        Assign a value to an internal variable, option, etc.
  354.     |:execute|    Execute a command formed by an expression.
  355.     etc.
  356.  
  357. Viminfo                            |viminfo-file|
  358.     The command-line history, marks and registers can be stored in a file
  359.     that is read on startup.  This can be used to repeat a search command
  360.     or command-line command after exiting and restarting Vim.  It is also
  361.     possible to jump right back to where the last edit stopped with "'0".
  362.     The 'viminfo' option can be set to select which items to store in the
  363.     .viminfo file.  This is off by default.
  364.  
  365. Mouse support                        |mouse-using|
  366.     The mouse is supported in the GUI version, in an xterm for Unix, for
  367.     Linux with gpm, for MS-DOS, and Win32.  It can be used to position the
  368.     cursor, select the visual area, paste a register, etc.
  369.  
  370. Usage of key names                    |<>| |key-notation|
  371.     Special keys now all have a name like <Up>, <End>, etc.
  372.     This name can be used in mappings, to make it easy to edit them.
  373.  
  374. Editing binary files                    |edit-binary|
  375.     Vim can edit binary files.  You can change a few characters in an
  376.     executable file, without corrupting it.  Vim doesn't remove NUL
  377.     characters (they are represented as <NL> internally).
  378.     |-b|        command-line argument to start editing a binary file
  379.     |'binary'|    Option set by "-b".  Prevents adding an <EOL> for the
  380.             last line in the file.
  381.  
  382. Multi-language support                    |multi-lang|
  383.     Files in double-byte or multi-byte encodings can be edited.  There is
  384.     UTF-8 support to be able various languages at the same time, without
  385.     switching fonts. |UTF-8|
  386.     Messages and menus are available in different languages.
  387.  
  388. ==============================================================================
  389. 5. Other vim features                    *other-features*
  390.  
  391. A random collection of nice extra features.
  392.  
  393.  
  394. When Vim is started with "-s scriptfile", the characters read from
  395. "scriptfile" are treated as if you typed them.  If end of file is reached
  396. before the editor exits, further characters are read from the console.
  397.  
  398. The "-w" option can be used to record all typed characters in a script file.
  399. This file can then be used to redo the editing, possibly on another file or
  400. after changing some commands in the script file.
  401.  
  402. The "-o" option opens a window for each argument.  "-o4" opens four windows.
  403.  
  404. Vi requires several termcap entries to be able to work full-screen.  Vim only
  405. requires the "cm" entry (cursor motion).
  406.  
  407.  
  408. In command mode:
  409.  
  410. When the 'showcmd' option is set, the command characters are shown in the last
  411. line of the screen.  They are removed when the command is finished.
  412.  
  413. If the 'ruler' option is set, the current cursor position is shown in the
  414. last line of the screen.
  415.  
  416. 'U' still works after having moved off the last changed line and after 'u'.
  417.  
  418. Characters with the 8th bit set are displayed.  The characters between '~' and
  419. 0xa0 are displayed as "~?", "~@", "~A", etc., unless the "graphic' option is
  420. set.
  421.  
  422. '][' goes to the next ending of a C function ('}' in column 1).
  423. '[]' goes to the previous ending of a C function ('}' in column 1).
  424.  
  425. ']f', '[f' and 'gf' start editing the file whose name is under the cursor.
  426. CTRL-W f splits the window and starts editing the file whose name is under
  427. the cursor.
  428.  
  429. '*' searches forward for the identifier under the cursor, '#' backward.
  430. 'K' runs the program defined by the "keywordprg" option, with the identifier
  431. under the cursor as argument.
  432.  
  433. '%' can be preceded with a count.  The cursor jumps to the line that
  434. percentage down in the file.  The normal '%' function to jump to the matching
  435. brace skips braces inside quotes.
  436.  
  437. With the CTRL-] command, the cursor may be in the middle of the identifier.
  438.  
  439. The used tags are remembered.  Commands that can be used with the tag stack
  440. are CTRL-T, ':pop' and ':tag'.  ':tags' lists the tag stack.
  441.  
  442. The 'tags' option can be set to a list of tag file names.  Thus multiple
  443. tag files can be used.  For file names that start with '.', the '.' is
  444. replaced with the path of the current file.  This makes it possible to use a
  445. tags file in the same directory as the file being edited.
  446.  
  447. Previously used file names are remembered in the alternate file name list.
  448. CTRL-^ accepts a count, which is an index in this list.
  449.  
  450. Search patterns have more features.  The <NL> character is seen as part of the
  451. search pattern and the substitute string of ":s".  Vi sees it as the end of
  452. the command.
  453.  
  454. Searches can put the cursor on the end of a match and may include a character
  455. offset.
  456.  
  457. Count added to '~', ':next', ':Next', 'n' and 'N'.
  458.  
  459. The command ":next!" with 'autowrite' set does not write the file.  In vi the
  460. file was written, but this is considered to be a bug, because one does not
  461. expect it and the file is not written with ':rewind!'.
  462.  
  463. In Vi when entering a <CR> in replace mode deletes a character only when 'ai'
  464. is set (but does not show it until you hit <Esc>).  Vim always deletes a
  465. character (and shows it immediately).
  466.  
  467. Added :wnext command.  Same as ":write" followed by ":next".
  468.  
  469. The ":w!" command always writes, also when the file is write protected.  In Vi
  470. you would have to do ":!chmod +w %" and ":set noro".
  471.  
  472. When 'tildeop' has been set, '~' is an operator (must be followed by a
  473. movement command).
  474.  
  475. With the 'J' (join) command you can reset the 'joinspaces' (js) option to
  476. have only one space after a period (Vi inserts two spaces).
  477.  
  478. 'cw' can be used to change white space formed by several characters (Vi is
  479. confusing: 'cw' only changes one space, while 'dw' deletes all white space).
  480.  
  481. 'o' and 'O' accept a count for repeating the insert (Vi clears a part of
  482. display).
  483.  
  484. Previously used file names are remembered in the alternate file name list.
  485. ":files" command shows the list of alternate file names.
  486. '#'<N> is replaced with the <N>th alternate file name in the list.
  487. "#<" is replaced with the current file name without extension.
  488.  
  489. Flags after Ex commands not supported (no plans to include it).
  490.  
  491. On non-UNIX systems ":cd" command shows current directory instead of going to
  492. the home directory (there isn't one).  ":pwd" prints the current directory on
  493. all systems.
  494.  
  495. After a ":cd" command the file names (in the argument list, opened files)
  496. still point to the same files.  In Vi ":cd" is not allowed in a changed file;
  497. otherwise the meaning of file names change.
  498.  
  499. ':source!' command reads Vi commands from a file.
  500.  
  501. ':mkexrc' command writes current modified options and mappings to a ".exrc"
  502. file.  ':mkvimrc' writes to a ".vimrc" file.
  503.  
  504. No check for "tail recursion" with mappings.  This allows things like
  505. ":map! foo ^]foo".
  506.  
  507. When a mapping starts with number, vi loses the count typed before it (e.g.
  508. when using the mapping ":map g 4G" the command "7g" goes to line 4).  This is
  509. considered a vi bug.  Vim concatenates the counts (in the example it becomes
  510. "74G"), as most people would expect.
  511.  
  512. The :put! command inserts the contents of a register above the current line.
  513.  
  514. The 'p' and 'P' commands of vi cannot be repeated with '.' when the putted
  515. text is less than a line.  In Vim they can always be repeated.
  516.  
  517. ":noremap" command can be used to enter a mapping that will not be remapped.
  518. This is useful to exchange the meaning of two keys.  ":cmap", ":cunmap" and
  519. ":cnoremap" can be used for mapping in command-line editing only.  ":imap",
  520. ":iunmap" and ":inoremap" can be used for mapping in insert mode only.
  521. Similar commands exist for abbreviations: ":noreabbrev", ":iabbrev"
  522. ":cabbrev", ":iunabbrev", ":cunabbrev", ":inoreabbrev", ":cnoreabbrev".
  523.  
  524. In Vi the command ":map foo bar" would remove a previous mapping
  525. ":map bug foo".  This is considered a bug, so it is not included in Vim.
  526. ":unmap! foo" does remove ":map! bug foo", because unmapping would be very
  527. difficult otherwise (this is vi compatible).
  528.  
  529. The ':' register contains the last command-line.
  530. The '%' register contains the current file name.
  531. The '.' register contains the last inserted text.
  532.  
  533. ':dis' command shows the contents of the yank registers.
  534.  
  535. CTRL-O/CTRL-I can be used to jump to older/newer positions.  These are the
  536. same positions as used with the '' command, but may be in another file.  The
  537. ':jumps' command lists the older positions.
  538.  
  539. If the 'shiftround' option is set, an indent is rounded to a multiple of
  540. 'shiftwidth' with '>' and '<' commands.
  541.  
  542. The 'scrolljump' option can be set to the minimum number of lines to scroll
  543. when the cursor gets off the screen.  Use this when scrolling is slow.
  544.  
  545. The 'scrolloff' option can be set to the minimum number of lines to keep
  546. above and below the cursor.  This gives some context to where you are
  547. editing.  When set to a large number the cursor line is always in the middle
  548. of the window.
  549.  
  550. Uppercase marks can be used to jump between files.  The ':marks' command lists
  551. all currently set marks.  The commands "']" and "`]" jump to the end of the
  552. previous operator or end of the text inserted with the put command.  "'[" and
  553. "`[" do jump to the start.
  554.  
  555. The 'shelltype' option can be set to reflect the type of shell used on the
  556. Amiga.
  557.  
  558. The 'highlight' option can be set for the highlight mode to be used for
  559. several commands.
  560.  
  561. The CTRL-A (add) and CTRL-X (subtract) commands are new.  The count to the
  562. command (default 1) is added to/subtracted from the number at or after the
  563. cursor.  That number may be decimal, octal (starts with a '0') or hexadecimal
  564. (starts with '0x').  Very useful in macros.
  565.  
  566. With the :set command the prefix "inv" can be used to invert boolean options.
  567.  
  568. In both Vi and Vim you can create a line break with the ":substitute" command
  569. by using a CTRL-M.  For Vi this means you cannot insert a real CTRL-M in the
  570. text.  With Vim you can put a real CTRL-M in the text by preceding it with a
  571. CTRL-V.
  572.  
  573.  
  574. In Insert mode:
  575.  
  576. If the 'revins' option is set, insert happens backwards.  This is for typing
  577. Hebrew.  When inserting normal characters the cursor will not be shifted and
  578. the text moves rightwards.  Backspace, CTRL-W and CTRL-U will also work in
  579. the opposite direction.  CTRL-B toggles the 'revins' option.  In replace mode
  580. 'revins' has no effect.  Only when enabled at compile time.
  581.  
  582. The backspace key can be used just like CTRL-D to remove auto-indents.
  583.  
  584. You can backspace, ctrl-U and CTRL-W over line breaks if the 'backspace' (bs)
  585. option includes "eol".  You can backspace over the start of insert if the
  586. 'backspace' option includes "start".
  587.  
  588. When the 'paste' option is set, a few option are reset and mapping in insert
  589. mode and abbreviation are disabled.  This allows for pasting text in windowing
  590. systems without unexpected results.  When the 'paste' option is reset, the old
  591. option values are restored.
  592.  
  593. CTRL-T/CTRL-D always insert/delete an indent in the current line, no matter
  594. what column the cursor is in.
  595.  
  596. CTRL-@ (insert previously inserted text) works always (Vi: only when typed as
  597. first character).
  598.  
  599. CTRL-A works like CTRL-@ but does not leave insert mode.
  600.  
  601. CTRL-R {0-9a-z..} can be used to insert the contents of a register.
  602.  
  603. When the 'smartindent' option is set, C programs will be better auto-indented.
  604. With 'cindent' even more.
  605.  
  606. CTRL-Y and CTRL-E can be used to copy a character from above/below the
  607. current cursor position.
  608.  
  609. After CTRL-V you can enter a three digit decimal number.  This byte value is
  610. inserted in the text as a single character.  Useful for international
  611. characters that are not on your keyboard.
  612.  
  613. When the 'expandtab' (et) option is set, a <Tab> is expanded to the
  614. appropriate number of spaces.
  615.  
  616. The window always reflects the contents of the buffer (Vi does not do this
  617. when changing text and in some other cases).
  618.  
  619. If Vim is compiled with DIGRAPHS defined, digraphs are supported.  A set of
  620. normal digraphs is included.  They are shown with the ":digraph" command.
  621. More can be added with ":digraph {char1}{char2} {number}".  A digraph is
  622. entered with "CTRL-K {char1} {char2}" or "{char1} BS {char2}" (only when
  623. 'digraph' option is set).
  624.  
  625. When repeating an insert, e.g. "10atest <Esc>" vi would only handle wrapmargin
  626. for the first insert.  Vim does it for all.
  627.  
  628. A count to the 'i' or 'a' command is used for all the text.  Vi uses the count
  629. only for one line.  "3iabc<NL>def<Esc>" would insert "abcabcacc<NL>def" in Vi
  630. but "abc<NL>defabc<NL>defabc<NL>def" in Vim.
  631.  
  632.  
  633. In Command-line mode:
  634.  
  635. <Esc> terminates the command-line without executing it. In vi the command
  636. line would be executed, which is not what most people expect (hitting <Esc>
  637. should always get you back to command mode).  To avoid problems with some
  638. obscure macros, an <Esc> in a macro will execute the command.  If you want a
  639. typed <Esc> to execute the command like vi does you can fix this with
  640.     ":cmap ^V<Esc> ^V<CR>"
  641.  
  642. General:
  643.  
  644. The 'ttimeout' option is like 'timeout', but only works for cursor and
  645. function keys, not for ordinary mapped characters.  The 'timeoutlen' option
  646. gives the number of milliseconds that is waited for.  If the 'esckeys' option
  647. is not set, cursor and function keys that start with <Esc> are not recognized
  648. in insert mode.
  649.  
  650. There is an option for each terminal string.  Can be used when termcap is not
  651. supported or to change individual strings.
  652.  
  653. The 'fileformat' option can be set to select the <EOL>: "dos" <CR><NL>, "unix"
  654. <NL> or "mac" <CR>.
  655. When the 'fileformats' option is not empty, Vim tries to detect the type of
  656. <EOL> automatically.  The 'fileformat' option is set accordingly.
  657.  
  658. On systems that have no job control (older Unix systems and non-Unix systems)
  659. the CTRL-Z, ":stop" or ":suspend" command starts a new shell.
  660.  
  661. If Vim is started on the Amiga without an interactive window for output, a
  662. window is opened (and :sh still works).  You can give a device to use for
  663. editing with the '-d' argument, e.g. "-d con:20/20/600/150".
  664.  
  665. The 'columns' and 'lines' options are used to set or get the width and height
  666. of the display.
  667.  
  668. Option settings are read from the first and last few lines of the file.
  669. Option 'modelines' determines how many lines are tried (default is 5).  Note
  670. that this is different from the Vi versions that can execute any Ex command
  671. in a modeline (a major security problem).  |trojan-horse|
  672.  
  673. If the 'insertmode' option is set (e.g. in .exrc), Vim starts in insert mode.
  674. And it comes back there, when pressing <Esc>.
  675.  
  676. Undo information is kept in memory.  Available memory limits the number and
  677. size of change that can be undone.  This may be a problem with MS-DOS, is
  678. hardly a problem on the Amiga and almost never with Unix and Win32.
  679.  
  680. If the 'backup' or 'writebackup' option is set: Before a file is overwritten,
  681. a backup file (.bak) is made.  If the "backup" option is set it is left
  682. behind.
  683.  
  684. Vim creates a file ending in ".swp" to store parts of the file that have been
  685. changed or that do not fit in memory.  This file can be used to recover from
  686. an aborted editing session with "vim -r file".  Using the swap file can be
  687. switched off by setting the 'updatecount' option to 0 or starting Vim with
  688. the "-n" option.  Use the 'directory' option for placing the .swp file
  689. somewhere else.
  690.  
  691. Vim is able to work correctly on filesystems with 8.3 file names, also when
  692. using messydos or crossdos filesystems on the Amiga, or any 8.3 mounted
  693. filesystem under Unix.  See |'shortname'|.
  694.  
  695. Error messages are shown at least one second (Vi overwrites error messages).
  696.  
  697. If Vim gives the |hit-enter| prompt, you can hit any key.  Characters other
  698. than <CR>, <NL> and <Space> are interpreted as the (start of) a command.  (Vi
  699. only accepts a command starting with ':').
  700.  
  701. The contents of the numbered and unnamed registers is remembered when
  702. changing files.
  703.  
  704. The "No lines in buffer" message is a normal message instead of an error
  705. message, since that may cause a mapping to be aborted.
  706.  
  707. The AUX: device of the Amiga is supported.
  708.  
  709. ==============================================================================
  710. 6. Command-line arguments                *cmdline-arguments*
  711.  
  712. Different versions of Vi have different command-line arguments.  This can be
  713. confusing.  To help you, this section gives an overview of the differences.
  714.  
  715. Five variants of Vi will be considered here:
  716.     Elvis    Elvis version 2.1b
  717.     Nvi    Nvi version 1.79
  718.     Posix    Posix 1003.2
  719.     Vi    Vi version 3.7 (for Sun 4.1.x)
  720.     Vile    Vile version 7.4 (incomplete)
  721.     Vim    Vim version 5.2
  722.  
  723. Only Vim is able to accept options in between and after the file names.
  724.  
  725. +{command}    Elvis, Nvi, Posix, Vi, Vim: Same as "-c {command}".
  726.  
  727. -        Nvi, Posix, Vi: Run Ex in batch mode.
  728.         Vim: Read file from stdin (use -s for batch mode).
  729.  
  730. --        Vim: End of options, only file names are following.
  731.  
  732. --help        Vim: show help message and exit.
  733.  
  734. --literal    Vim: take file names literally, don't expand wildcards.
  735.  
  736. --noplugin[s]    Vim: Skip loading plugins.
  737.  
  738. --remote    Vim: edit the files in another Vim server
  739.  
  740. --remote-wait    Vim: edit the files in another Vim server and wait for it
  741.  
  742. --remote-expr {expr}    Vim: evaluate {expr} in another Vim server
  743.  
  744. --remote-send {keys}    Vim: send {keys} to a Vim server and exit
  745.  
  746. --serverlist    Vim: Output a list of Vim servers and exit
  747.  
  748. --servername {name}    Vim: Specify Vim server name
  749.  
  750. --socketid {id}        Vim: GTK window socket to run Vim in
  751.  
  752. --version    Vim: show version message and exit.
  753.  
  754. -?        Vile: print usage summary and exit.
  755.  
  756. -a        Elvis: Load all specified file names into a window (use -o for
  757.         Vim).
  758.  
  759. -b {blksize}    Elvis: Use {blksize} blocksize for the session file.
  760. -b        Vim: set 'binary' mode.
  761.  
  762. -C        Vim: Compatible mode.
  763.  
  764. -c {command}    Elvis, Nvi, Posix, Vim: run {command} as an Ex command after
  765.         loading the edit buffer.
  766.         Vim: allow up to 10 "-c" arguments
  767.  
  768. -d {device}    Vim: Use {device} for I/O (Amiga only). {only when compiled
  769.         without the |+diff| feature}
  770. -d        Vim: start with 'diff' set. |vimdiff|
  771.  
  772. -dev {device}    Vim: Use {device} for I/O (Amiga only).
  773.  
  774. -D        Vim: debug mode.
  775.  
  776. -e        Elvis, Nvi, Vim: Start in Ex mode, as if the executable is
  777.         called "ex".
  778.  
  779. -E        Vim: Start in improved Ex mode |gQ|, like "exim".
  780.  
  781. -f        Vim: Run GUI in foreground (Amiga: don't open new window).
  782. -f {session}    Elvis: Use {session} as the session file.
  783.  
  784. -F        Vim: Start in Farsi mode (when compiled with Farsi).
  785.         Nvi: Fast start, don't read the entire file when editing
  786.         starts.
  787.  
  788. -G {gui}    Elvis: Use the {gui} as user interface.
  789.  
  790. -g        Vim: Start GUI.
  791. -g N        Vile: start editing at line N
  792.  
  793. -h        Vim: Give help message.
  794.         Vile: edit the help file
  795.  
  796. -H        Vim: start Hebrew mode (when compiled with it).
  797.  
  798. -i        Elvis: Start each window in Insert mode.
  799. -i {viminfo}    Vim: Use {viminfo} for viminfo file.
  800.  
  801. -L        Vim: Same as "-r" (also in some versions of Vi).
  802.  
  803. -l        Nvi, Vi, Vim: Set 'lisp' and 'showmatch' options.
  804.  
  805. -m        Vim: Modifications not allowed to be written, resets 'write'
  806.         option.
  807.  
  808. -M        Vim: Modifications not allowed, resets 'modifiable' and the
  809.         'write' option.
  810.  
  811. -N        Vim: No-compatible mode.
  812.  
  813. -n        Vim: No swap file used.
  814.  
  815. -O[N]        Vim: Like -o, but use vertially split windows.
  816.  
  817. -o[N]        Vim: Open [N] windows, or one for each file.
  818.  
  819. -q {name}    Vim: Use {name} for quickfix error file.
  820. -q{name}    Vim: Idem.
  821.  
  822. -R        Elvis, Nvi, Posix, Vile, Vim: Set the 'readonly' option.
  823.  
  824. -r        Elvis, Nvi, Posix, Vi, Vim: Recovery mode.
  825.  
  826. -S        Nvi: Set 'secure' option.
  827. -S {script}    Vim: source script after starting up.
  828.  
  829. -s        Nvi, Posix, Vim: Same as "-" (silent mode), when in Ex mode.
  830.         Elvis: Sets the 'safer' option.
  831. -s {scriptin}    Vim: Read from script file {scriptin}; only when not in Ex
  832.         mode.
  833. -s {pattern}    Vile: search for {pattern}
  834.  
  835. -t {tag}    Elvis, Nvi, Posix, Vi, Vim: Edit the file containing {tag}.
  836. -t{tag}        Vim: Idem.
  837.  
  838. -T {term}    Vim: Set terminal name to {term}.
  839.  
  840. -u {vimrc}    Vim: Read initializations from {vimrc} file.
  841.  
  842. -U {gvimrc}    Vim: Read GUI initializations from {gvimrc} file.
  843.  
  844. -v        Nvi, Posix, Vi, Vim: Begin in Normal mode (visual mode, in Vi
  845.         terms).
  846.         Vile: View mode, no changes possible.
  847.  
  848. -V        Elvis, Vim: Verbose mode.
  849. -V{nr}        Vim: Verbose mode with specified level.
  850.  
  851. -w {size}    Elvis, Posix, Nvi, Vi, Vim: Set value of 'window' to {size}.
  852. -w{size}    Nvi, Vi: Same as "-w {size}".
  853. -w {name}    Vim: Write to script file {name} (must start with non-digit).
  854.  
  855. -W {name}    Vim: Append to script file {name}.
  856.  
  857. -x        Vi, Vim: Ask for encryption key.  See |encryption|.
  858.  
  859. -X        Vim: Don't connect to the X server.
  860.  
  861. -y        Vim: Start in easy mode, like |evim|.
  862.  
  863. -Z        Vim: restricted mode
  864.  
  865. @{cmdfile}    Vile: use {cmdfile} as startup file.
  866.  
  867.  vim:tw=78:ts=8:ft=help:norl:
  868.